package com.mijie.homi.admin.service.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mijie.core.Paging;
import com.mijie.homi.admin.dao.user.IntegrationDao;
import com.mijie.homi.common.domain.Integration;

@Service
public class IntegrationService {

	@Autowired
	private IntegrationDao dao;
	
	public int addIntegration(Integration integral){
		return dao.addIntegration(integral);
	}
	
	public int updateIntegration(Integration integral){
		return dao.updateIntegration(integral);
	}
	
	public void listIntegration(Paging<Integration> paging){
		dao.listIntegration(paging);
	}
	
	public Integration getIntegrationById(int id){
		return dao.getIntegrationById(id);
	}
	
	public boolean haveReward(int id){
		return dao.haveReward(id);
	}
	
	public Integer getTodayIntegralReward(int userId,int actionId){
		return dao.getTodayIntegralReward(userId, actionId);
	}
	
	public int updateIntegralRewardDetail(int userId,int actionId,int integral){
		return dao.updateIntegralRewardDetail(userId, actionId, integral);
	}
	
	
}
